<?php
	require 'php-sdk/src/facebook.php';
	$facebook = new Facebook(array(
		'appId'  => '176213615761250',
		'secret' => '375110a154f2a4f5b2f6e4f8f093f7be',
	));

	$user = $facebook->getUser();

	if ($user) {
		try {
			$user_profile = $facebook->api('/me');
			echo "$user_profile[name] has logged in!";
		} catch (FacebookApiException $e) {
			echo "FB error $e";
		}
	}
	else echo "undifined user";
?>
